export function handleAuthorize() {
  let appid = "wx5b8ebbd4cbac6c69";
  let redirectUri = encodeURIComponent("http://www.cbda1984.com/h5/");
  let responseType = "code";
  let scope = "snsapi_userinfo";
  let authorizeUrl =
    "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
    appid +
    "&redirect_uri=" +
    redirectUri +
    "&response_type=" +
    responseType +
    "&scope=" +
    scope +
    "&connect_redirect=1#wechat_redirect";
  window.location.href = authorizeUrl;
}
export function getQueryString(name) {
  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

  var r = window.location.search.substr(1).match(reg);
  if (r != null) {
    return unescape(r[2]);
  }
  return null;
}
export function handleAuthorizeNo() {
  var auth_url =
    "https://open.weixin.qq.com/connect/qrconnect?appid=" +
    "wx5855dc06649e1945" +
    "&redirect_uri=" +
    encodeURIComponent("http://www.cbda1984.com/h5/") +
    "&response_type=code&scope=" +
    "snsapi_login";
  window.location.replace(auth_url);
}
